package com.hjm.project.ActStage.ActStage.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hjm.project.ActStage.ActStage.mapper.ActStageMapper;
import com.hjm.project.ActStage.ActStage.domain.ActStage;
import com.hjm.project.ActStage.ActStage.service.IActStageService;
import com.hjm.common.utils.text.Convert;

/**
 * 阶梯Service业务层处理
 * 
 * @author LOVE
 * @date 2020-11-29
 */
@Service
public class ActStageServiceImpl implements IActStageService 
{
    @Autowired
    private ActStageMapper actStageMapper;

    @Override
    public List<Map<String, Object>> getActStageList(Map<String, Object> stageParams) {
        return actStageMapper.getActStageList(stageParams);
    }

    @Override
    public List<Map<String, Object>> getActStage(Map<String, Object> map) throws Exception {
        return actStageMapper.getActStage(map);
    }
    /**
     * 查询阶梯
     * 
     * @param id 阶梯ID
     * @return 阶梯
     */
    @Override
    public ActStage selectActStageById(Long id)
    {
        return actStageMapper.selectActStageById(id);
    }

    /**
     * 查询阶梯列表
     * 
     * @param actStage 阶梯
     * @return 阶梯
     */
    @Override
    public List<ActStage> selectActStageList(ActStage actStage)
    {
        return actStageMapper.selectActStageList(actStage);
    }

    /**
     * 新增阶梯
     * 
     * @param actStage 阶梯
     * @return 结果
     */
    @Override
    public int insertActStage(ActStage actStage)
    {
        return actStageMapper.insertActStage(actStage);
    }

    /**
     * 修改阶梯
     * 
     * @param actStage 阶梯
     * @return 结果
     */
    @Override
    public int updateActStage(ActStage actStage)
    {
        return actStageMapper.updateActStage(actStage);
    }

    @Override
    public boolean updateActStages(Map<String, Object> map) throws Exception {
        return actStageMapper.updateActStages(map)>0;
    }

    /**
     * 删除阶梯对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteActStageByIds(String ids)
    {
        return actStageMapper.deleteActStageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除阶梯信息
     * 
     * @param id 阶梯ID
     * @return 结果
     */
    @Override
    public int deleteActStageById(Long id)
    {
        return actStageMapper.deleteActStageById(id);
    }


    @Override
    public int getNextval() throws Exception {
        return Integer.parseInt(String.valueOf(actStageMapper.getNextval()));
    }

    @Override
    public boolean addActStage(Map<String, Object> map) throws Exception {
        return actStageMapper.addActStage(map)>0;
    }
}
